import { get, post } from "../../request/http";

/**
 * 给课时添加课件
 * @param params
 * @returns {Promise}
 */
export function addCoursewareForPeriod(params) {
  return post('/education/courseware/addCoursewareForPeriod', params)
}

/**
 * 根据课时id删除课件
 * @param coursewareId 课件id
 * @param params
 * @returns {Promise}
 */
export function deleteCourseware (coursewareId, params) {
  return post(`/education/courseware/deleteCourseware?coursewareId=${coursewareId}`, params)
}

/**
 * 根据课时id获取课件
 * @param params
 * @returns {Promise}
 */
export function getCoursewareByPeriodId(params) {
  return get("/education/courseware/getCoursewareByPeriodId", params)
}

/**
 * 教师根据课程id获取课件总数
 * @param params
 * @returns {Promise}
 */
export function getNumberOfCourseware(params) {
  return post('/education/courseware/getNumberOfCourseware', params)
}

/**
 * 为课时添加课时测试
 * @param {type} params 
 */
export function addChapterTest(params){
	return post('/education/chapterTest/addChapterTest',params)
}
/**
 * 根据课时id获取课时测试
 * @param {Object} params
 */
export function getChapterTestByPeriodId(params){
	return post("/education/chapterTest/getChapterTestByPeriodId",params)
}
/**
 * @param {Object} params
 * 文件下载
 */
export function download(params){
	return get("/minio/download",params)
}